CREATE TABLE [dbo].[TTAMAR_CPAG]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[FE_ANUL] [dbo].[TD_DT_001] NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NULL CONSTRAINT [DF__TTAMAR_CP__ST_CO__36DC0ACC] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTAMAR_CP__NU_PR__38C4533E] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_CP__CO_US__39B87777] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_CP__FE_US__3AAC9BB0] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_CP__CO_US__3BA0BFE9] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_CP__FE_US__3C94E422] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_CPAG] WITH NOCHECK ADD CONSTRAINT [CK__TTAMAR_CP__ST_CO__37D02F05] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTAMAR_CPAG] ADD CONSTRAINT [PK__TTAMAR_C__2F1962B2398E5A45] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_CPAG] ADD CONSTRAINT [FK__TTAMAR_CP__CO_EM__2E3CA32A] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TTAMAR_CPAG] ADD CONSTRAINT [FK__TTAMAR_CPAG__2D487EF1] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) REFERENCES [dbo].[TCAMAR_CPAG] ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR])
GO
